.side-filters
  = form_tag filter_path(entity), method: 'get' do
    - if current_user
      %fieldset.scope-filter
        %ul.nav.nav-pills.nav-stacked
          %li{class: ("active" if params[:scope] == 'assigned-to-me')}
            = link_to filter_path(entity, scope: 'assigned-to-me') do
              Assigned to me
              %span.pull-right
                = assigned_entities_count(current_user, entity, @group)
          %li{class: ("active" if params[:scope] == 'authored')}
            = link_to filter_path(entity, scope: 'authored') do
              Created by me
              %span.pull-right
                = authored_entities_count(current_user, entity, @group)
          %li{class: ("active" if params[:scope] == 'all')}
            = link_to filter_path(entity, scope: 'all') do
              Everyone's
              %span.pull-right
                = authorized_entities_count(current_user, entity, @group)

    %fieldset.status-filter
      %legend State
      %ul.nav.nav-pills
        %li{class: ("active" if params[:state] == 'opened')}
          = link_to filter_path(entity, state: 'opened') do
            Open
        %li{class: ("active" if params[:state] == 'closed')}
          = link_to filter_path(entity, state: 'closed') do
            Closed
        %li{class: ("active" if params[:state] == 'all')}
          = link_to filter_path(entity, state: 'all') do
            All

    %fieldset
      %legend Projects
      %ul.nav.nav-pills.nav-stacked.nav-small
        - @projects.each do |project|
          - unless entities_per_project(project, entity).zero?
            %li{class: ("active" if params[:project_id] == project.id.to_s)}
              = link_to filter_path(entity, project_id: project.id) do
                = project.name_with_namespace
                %small.pull-right= entities_per_project(project, entity)

    %fieldset
      - if params[:state].present? || params[:project_id].present?
        = link_to filter_path(entity, state: nil, project_id: nil), class: 'pull-right cgray' do
          %i.fa.fa-times
          %strong Clear filter

